(function($f) {	$f.extend.custom("myPlugin2", "4c66b938-5b8f-4a61-b76d-498d107f15ce", function(self) {

	"use strict";
	
	// plugin info
	this.info = {
		title: "My Plugin 2",
		version: "0.0.1" // major.minor.build
	};
	
	// pre-initialization handler
	// called just after plugin instance is created and no features or includes are processed
	// returns (boolean): 
	//	true: if success 
	//	false: if failed
	this.onPreInit = function() { 
		// log
		$f.myPlugin1.lifeCycleElement().append("<p><b>preInit:</b> " + self.info.title + " is instantiated and will be initialized.");

		return true;
	};
	
	// initialization handler
	// called when all includes are processed and features etc. are added
	// returns (boolean): 
	//	true: if success 
	//	false: if failed
	this.onInit = function() { 
		// log
		$f.myPlugin1.lifeCycleElement().append("<p><b>init:</b> " + self.info.title + " is initialized now.");

		return true;
	};

	// load handler
	// returns: (void)
	this.onLoad = function() {
		// log
		$f.myPlugin1.lifeCycleElement().append("<p><b>load:</b> " + self.info.title + " is loaded now.");
	};
	
	// ready handler
	// returns: (void)
	this.onReady = function() {
		// log
		$f.myPlugin1.lifeCycleElement().append("<p><b>ready:</b> Plugin is ready now. " + self.info.title + " will do ready-time processing now.");
	};
	
	// load a plugin dynamically
	this.loadPlugin = function() {
		if ($f.has.feature("dynamicExtend")) {
			if (!$f.myPlugin3) {
				// load plugin programatically
				$f.extend.fromFile("myPlugin3.debug.js", "myPlugin3", function(data, isError) { 
					if (!isError) {
						$f.alert($f.myPlugin3.info.title + " is available now.");
					} else {
						$f.alert("Plugin could not be loaded.");
					};
				});
			} else {
				$f.alert($f.myPlugin3.info.title + " is already loaded.");
			};
		} else {
			$f.alert("'dynamicExtend' feature is not available.");
		};
	};
}); }(fluid));
